/*
 * Mutex.h
 *
 *  Created on: 29.01.2013
 *      Author: ILYA
 */
/*
#ifndef MUTEX_H_
#define MUTEX_H_

//#include "FreeRTOSConfig.h" //in this module I have put this <#define configUSE_MUTEXES		  1>
#include "FreeRTOS.h"
#include "semphr.h"
#include "Task.h"
#define NeverTimeout portMAX_DELAY
//#define Lock_cfg xSemaphoreTake( xMutex_cfg, portMAX_DELAY )
//#define UnLock_cfg xSemaphoreGive( xMutex_cfg );

xTaskHandle current_Cfg_task_handle;
xSemaphoreHandle xMutex_cfg;
xTaskHandle current_ext_flash_task_handle;
xSemaphoreHandle xMutex_ext_flash;
xTaskHandle current_int_flash_task_handle;
xSemaphoreHandle xMutex_int_flash;
void MutexInit(void);
void Lock_cfg(void);
int TryLock_cfg(int timeout); //specify time in milliseconds
void UnLock_cfg(void);
void Lock_ext_flash(void);
int TryLock_ext_flash(int timeout); //specify time in milliseconds
void UnLock_ext_flash(void);
void Lock_int_flash(void);
int TryLock_int_flash(int timeout); //specify time in milliseconds
void UnLock_int_flash(void);
#endif *//* MUTEX_H_ */
